<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>bootstrap datatable demo</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">




<link rel="stylesheet" type="text/css"
	href="http://sandbox.runjs.cn/uploads/rs/238/n8vhm36h/bootstrap.min.css">
<link rel="stylesheet" type="text/css"
	href="http://sandbox.runjs.cn/uploads/rs/238/n8vhm36h/bootstrap-responsiv.css">


<link rel="stylesheet" type="text/css"
	href="http://sandbox.runjs.cn/uploads/rs/238/n8vhm36h/dataTables.bootstra.css">
</head>

<body>

	<div class="container-fluid">
		<div class="row-fluid">

			<div>
				<ul class="breadcrumb">
					<li>员工信息管理 <span class="divider">></span>
					</li>
					<li>员工信息查看</li>
				</ul>
			</div>
		</div>
			<div style="padding-bottom: 20px"><input type="button" id="queryBtn"  class="btn btn-primary" onclick="javascript:showText('<%=path%>/rest/employee/addEmployeeJsp')" value="添加新员工" /></div> 
		<div class="row-fluid">

			<table
				class="table table-striped table-bordered table-hover datatable">
				<thead>
					<tr>
						<c:set value="${fn:split(pageModel.th_list,',') }" var="ths"></c:set>
						<c:forEach items="${ths }" var="th">
							<th>${th }</th>
						</c:forEach>
					</tr>
				</thead>
				<tbody>
					<!-- 数据信息 -->
					<c:forEach items="${list}" var="tds" varStatus="status">
						<tr class="odd gradeX">
							<td>${status.index + 1}</td>
							<td>${tds.eName }</td>
							<td>
								<c:if test="${tds.eSex==0 }">
								男
								</c:if>
								<c:if test="${tds.eSex==1 }">
								女
								</c:if>
							</td>
							<td>${tds.eIdcard }</td>
							<td>${tds.eTell }</td>
							<td>
								<c:if test="${tds.eType==0 }">
									人事
								</c:if>
								<c:if test="${tds.eType==1 }">
									行政
								</c:if>
								<c:if test="${tds.eType==2 }">
									客服 
								</c:if>
								<c:if test="${tds.eType==3 }">
								前台
								</c:if>
								<c:if test="${tds.eType==4 }">
								资料员
								</c:if>
								<c:if test="${tds.eType==5 }">
								仓库管理员
								</c:if>
								<c:if test="${tds.eType==6 }">
								水电工
								</c:if>
								<c:if test="${tds.eType==7 }">
								门卫
								</c:if>
								<c:if test="${tds.eType==8 }">
								保洁
								</c:if>
								<c:if test="${tds.eType==9 }">
								保安
								</c:if>
							</td>
							<c:if test="${tds.eStatus==0 }">
								<td><font color="red">离职</font></td>
							</c:if>
							<c:if test="${tds.eStatus==1 }">
								<td>在职</td>
							</c:if>						
							<td>${tds.eRemark }</td>
							<td>
								<c:if test="${tds.eStatus==1 }">
									<a href="<%=path %>/rest/employee/editEmployeeJsp?eid=${tds.eId }">修改</a>&nbsp;&nbsp;&nbsp;
									<a href="<%=path %>/rest/employee/deleteEmployee?eid=${tds.eId }">删除</a>
								</c:if>
								<c:if test="${tds.eStatus==0 }">
									<a href="<%=path %>/rest/employee/deleteEmployee?eid=${tds.eId }">删除</a>
								</c:if>
							</td>
						</tr>
					</c:forEach>
				</tbody>
			</table>
		</div>
		<script type="text/javascript"
			src="http://sandbox.runjs.cn/uploads/rs/238/n8vhm36h/jquery.js"></script>
		<script type="text/javascript"
			src="http://sandbox.runjs.cn/uploads/rs/238/n8vhm36h/jquery.dataTables.js"></script>
		<script type="text/javascript"
			src="http://sandbox.runjs.cn/uploads/rs/238/n8vhm36h/bootstrap.min.js"></script>
		<script type="text/javascript"
			src="http://sandbox.runjs.cn/uploads/rs/238/n8vhm36h/dataTables.bootstrap.js"></script>
	</div>
	<script type="text/javascript">
		$(document).ready(function() {
    			$('.datatable').dataTable( {        				
        				"oLanguage": {
								"sUrl": "<%=path%>/json/zh_CN.json"
				}
			});
		});
	</script>
	<script type="text/javascript">
		function showText(path) {
			top.topManager.openPage({
				id : 'addEmployee',
				href : path,
				title : '添加新员工'
			});
		}
	</script>
</body>

</html>
